package test.aop.interceptor;

import com.why.simpleboot.core.core.aop.entity.MethodInvocation;
import com.why.simpleboot.core.core.aop.interceptor.Interceptor;
import test.aop.service.B;

/**
 * @program: why-simpleboot-framework
 * @description:
 * @author: @why
 * @create: 2021-05-27 09:10
 **/
public class BInterceptor extends Interceptor {
    @Override
    public boolean supported(Object obj) {
        return obj instanceof B;
    }

    @Override
    public Object proceed(MethodInvocation methodInvocation) {
        System.out.println("---------------jdk---------------------");
        System.out.println("jdk处理前");

        Object result = methodInvocation.invoke();

        System.out.println("jdk处理后--->" + result);

        System.out.println("---------------jdk---------------------");
        return result;
    }
}
